<div id="primary_addreplicauser_gui">
  <form action="{{ url('/server/privileges') }}" method="post" autocomplete="off" id="addUsersForm" class="card">
    {{ get_hidden_inputs('', '') }}
    <input type="hidden" name="grant_count" value="25">
    <input type="hidden" name="createdb" id="createdb_0" value="0">
    {# Needed for the replication replicas. #}
    <input type="hidden" name="Repl_slave_priv" id="checkbox_Repl_slave_priv" value="Y">
    <input type="hidden" name="sr_take_action" value="true">
    <input type="hidden" name="adduser_submit" value="1">

    <div class="card-header">{{ t('Add replica replication user') }}</div>

    <div class="card-body" id="fieldset_add_user_login">
      <div class="item">
        <label for="select_pred_username">
          {{ t('User name:') }}
        </label>
        <span class="options">
          <select name="pred_username" id="select_pred_username" title="{{ t('User name') }}">
            <option value="any"{{ predefined_username == 'any' ? ' selected' }}>{{ t('Any user') }}</option>
            <option value="userdefined"{{ predefined_username == 'userdefined' ? ' selected' }}>{{ t('Use text field:') }}</option>
          </select>
        </span>
        <input type="text" name="username" id="pma_username" maxlength="{{ username_length }}" title="{{ t('User name') }}" value="{{ username }}" spellcheck="false">
      </div>

      <div class="item">
        <label for="select_pred_hostname">
          {{ t('Host:') }}
        </label>
        <span class="options">
          <select name="pred_hostname" id="select_pred_hostname" title="{{ t('Host') }}"
            {%- if this_host is not null %} data-thishost="{{ this_host }}"{% endif %}>
            <option value="any"{{ predefined_hostname == 'any' ? ' selected' }}>{{ t('Any host') }}</option>
            <option value="localhost"{{ predefined_hostname == 'localhost' ? ' selected' }}>{{ t('Local') }}</option>
            {% if this_host is not null %}
              <option value="thishost"{{ predefined_hostname == 'thishost' ? ' selected' }}>{{ t('This host') }}</option>
            {% endif %}
            <option value="hosttable"{{ predefined_hostname == 'hosttable' ? ' selected' }}>{{ t('Use host table') }}</option>
            <option value="userdefined"{{ predefined_hostname == 'userdefined' ? ' selected' }}>{{ t('Use text field:') }}</option>
          </select>
        </span>
        <input type="text" name="hostname" id="pma_hostname" maxlength="{{ hostname_length }}" title="{{ t('Host') }}" value="{{ hostname }}">
        {{ show_hint(t('When Host table is used, this field is ignored and values stored in Host table are used instead.')) }}
      </div>

      <div class="item">
        <label for="select_pred_password">
          {{ t('Password:') }}
        </label>
        <span class="options">
          <select name="pred_password" id="select_pred_password" title="{{ t('Password') }}">
            <option value="none"{{ has_username ? ' selected' }}>{{ t('No password') }}</option>
            <option value="userdefined"{{ not has_username ? ' selected' }}>{{ t('Use text field:') }}</option>
          </select>
        </span>
        <input type="password" id="text_pma_pw" name="pma_pw" title="{{ t('Password') }}" spellcheck="false">
      </div>

      <div class="item">
        <label for="text_pma_pw2">
          {{ t('Re-type:') }}
        </label>
        <span class="options"></span>
        <input type="password" id="text_pma_pw2" name="pma_pw2" title="{{ t('Re-type') }}" spellcheck="false">
      </div>

      <div class="item">
        <label for="button_generate_password">
          {{ t('Generate password:') }}
        </label>
        <span class="options">
          <input type="button" class="btn btn-secondary button" id="button_generate_password" value="{{ t('Generate') }}">
        </span>
        <input type="text" name="generated_pw" id="generated_pw">
      </div>
    </div>

    <div class="card-footer">
      <input class="btn btn-primary" type="submit" id="adduser_submit" value="{{ t('Go') }}">
    </div>
  </form>
</div>
